<template>
	<view>
		<cu-custom bgColor="bg-white" :isBack="true">
			<block slot="backText"></block>
			<block slot="content">获得奖励</block>
		</cu-custom>
		<view class="b-box">
			<view class="tc">
				<image :src="imgurl + 'fx_img18.png'" mode="" class="img-1"></image>
				<view class="mt20">
					<view class="fs34" v-text="rolename"></view>
					<view class="fs26 mt10 text-muted">恭喜您成为{{company}}的“{{rolename}}”</view>
				</view>
			</view>
			<view class="qui-cells bg-transparent mt30" v-if="ReceiveDetail.length>0">
				<view class="qui-cells-title" style="padding-left: 10px;"><text class="color-1 fs26">获得以下奖励</text></view>
				<view class="qui-cells-tips">
					
					<view class="qui-cell bg-white radius10 mb20" v-for="m in ReceiveDetail">
						<view class="cell-hd"><image :src="imgurl + 'fx_img14.png'" mode="" class="img50"></image></view>
						<view class="cell-bd ml5">
							<view>
								<text class="fs30 fw600">随机{{m.PrizeType==1?'零钱':'积分'}}</text>
								<text class="color-1 fs24">(m.Value)</text>
							</view>
							<view class="text-muted fs24">{{m.PrizeType==1?'已发放到微信零钱':'可用于积分商城购物'}}</view>
						</view>
						<view class="cell-ft arrow-r"></view>
					</view>
					
					
					
			
					</view>
				
			</view>
			<navigator class="qui-cells-foot" url="/pages/my/my" open-type="redirect"><view class="cu-btn lg mt30 bg-1 fw600 round text-white" style="width: 100%;">前往个人中心</view></navigator>
		</view>
	</view>
</template>

<script>
import base from 'utils/base.js';
import tools from 'utils/tools.js';
export default {
	data() {
		return {
			rolename:"",
			company:"",
			ReceiveDetail:[],
			imgurl: this.$imgurl
		};
	},
	onLoad(options) {
		let _self = this;
		let globalData = getApp().globalData;
		this.rolename=unescape(options.rolename);
        this.company=globalData.Customer.Name;
		_self.BindData(options.ids);
	},
	methods: {
		BindData: function(ids) {
			let currentPage = this;

			

			let params = {
				type: 'POST',
				url: '/api/ScanCodeDistribution/GetReceiveListByIds',
				data: { Ids: ids },
				sCallback: function(response) {
					if (response.IsSuccess) {
						let d = response.Data.data;
						if (d != null) {
							currentPage.ReceiveDetail = d;
						}
					}
				}
			};
			base.request(params);
		}
	},
	mounted() {}
};
</script>

<style lang="scss" scoped>
.b-box {
	background: linear-gradient(180deg, rgba(244, 158, 130, 0.5) 0%, rgba(255, 212, 201, 0) 100%);
	padding: 50rpx;
}
.img50 {
	width: 50rpx;
	height: 50rpx;
}
.img-1 {
	width: 200rpx;
	height: 200rpx;
}
.color-1 {
	color: #ff5e20;
}
.bg-1 {
	background: #ff5e20;
}
</style>
